package cn.gao.enums;

import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: GaoXu
 * @Date: 2022/05/20/14:40
 * @Description:
 */
@Getter
public enum FinalFloderEnum {

    EXE_FLODER("可执行文件夹",0),
    ZIP_FLODER("压缩包文件夹",1),
    IMG_FLODER("图片文件夹",2),
    DOC_FLODER("文档文件夹",3),
    PDF_FLODER("PDF文件夹",4),
    EXCEL_FLODER("Excel文件夹",5),
    OTHER_FLODER("其他格式文件夹",6),
    VEDIO_FLODER("视频文件夹",7),
    JAVA_FLODER("Java文件夹",8),
    ;

    private String pathName;
    private int code;

    FinalFloderEnum(String pathName,int code) {
        this.pathName = pathName;
        this.code = code;
    }
    public static FinalFloderEnum getPathNameByCode(int code) {
        FinalFloderEnum finalFloderEnum = Arrays.stream(FinalFloderEnum.values()).filter(f -> f.code == code).findFirst().orElse(null);
        return finalFloderEnum;
    }

    public static List<String> getAllFloder() {
        List<String> collect = Arrays.stream(FinalFloderEnum.values()).map(f -> f.pathName).collect(Collectors.toList());
        return collect;
    }
}
